<template>
  <!-- 定向包列表 -->
  <div>
    <div class="list-nav" v-for="(item,index) in listformat" :key="index">
      <div v-if="item.type === 'group'">
        <span class="list-title">{{ item.title }}</span>
        <span class="list">
          {{ item.foritem ? item.formatter(list[item.foritem][item.prop]) : item.formatter(list[item.prop]) }}
        </span>
      </div>
      <div v-if="item.type === 'array'">
        <span class="list-title">{{ item.title }}</span>
        <span class="list">
          {{ item.foritem ? list[item.foritem][item.prop] ? item.formatter(list[item.foritem][item.prop]) : '不限' : item.formatter(list[item.prop]) }}
        </span>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props:{
    list:{
      type:Object,
      required:true
    },
    listformat:{
      type:Array
    }
  },
  // created(){
  //   console.info(this.list,this.listformat,'1232')
  // }
}
</script>

<style lang="less" scoped>
  .list-nav{
    .list-title{
      color: #515A6E;
      margin-right:5px;
    }
    .list{
      color: #ACACAC;
    }
  }
</style>